package com.schoolMall.enums;

/**
 * @author:zyh
 * @Time:2021-08-31-19:46
 * @email:1269231889@qq.com
 */
public enum ProductCategoryStateEnum {
    FAIL(-1,"插入失败"),
    SUCCESS(1, "成功"),
    INNER_ERROR(-1001, "内部错误"),
    NULL_SHOP(-1002, "shop为空"),
    EMPTY_LIST(-1000,"productCategory列表为空");

    int val;
    String msg;


    ProductCategoryStateEnum(int val, String msg) {
        this.val = val;
        this.msg = msg;
    }

    public int getVal() {
        return val;
    }

    public String getMsg() {
        return msg;
    }

    public ProductCategoryStateEnum stateOf(int state){
        for (ProductCategoryStateEnum value : ProductCategoryStateEnum.values()) {
            if (value.getVal()==state){
                return value;
            }
        }
        return null;
    }
}
